Release 10.1A: OpenEdge Data Management:
DataServer for ORACLE
Data types
ORACLE data types differ from OpenEdge data types. However, each ORACLE internal data type supported by the DataServer has at least one OpenEdge equivalent.
The DataServer translates the ORACLE data types into OpenEdge equivalents. When an ORACLE data type has more than one OpenEdge equivalent, the DataServer supplies a default data type. The schema image contains the OpenEdge data definitions for the ORACLE columns, which you can modify by using the Data Dictionary. For example, the DataServer assigns the
Note: You cannot change the data type of a stored procedure parameter. Although you can use the Data Dictionary to view the stored procedure properties in the schema holder, you cannot modify them.NUMBERdata type the OpenEdge equivalent,DECIMAL. You can then change the data type fromDECIMALtoINTEGERorLOGICAL. See the "Modifying a schema image" section for an explanation of how to change OpenEdge data types in the schema image.ORACLE allows users to define their own data types, known as external data types. ORACLE converts these external types to an equivalent internal type. For example, a float data type maps to
NUMBER. The DataServer also considers it to be aNUMBERand maps it toDECIMALin the schema image.Table 2–5 lists the ORACLE internal data types supported by the DataServer and their OpenEdge equivalents. The table also shows the default equivalent supplied by the DataServer for those ORACLE data types with more than one OpenEdge equivalent. The sections directly following Table 2–5 provide additional details about several of the ORACLE data types and each data type’s OpenEdge equivalent.
Note: The only ORACLE internal data type that the DataServer does not support isROWID. The ORACLEROWID, however, has its programming equivalent in the OpenEdgeROWID. See the "ROWID function" section for more information.
ORACLE Char and Varchar2 data types
The
VARCHAR2data type does not pad data with trailing spaces. However, ORACLECHARdoes pad with trailing spaces. For example, in aCHARcolumn 20 characters wide, the entryMAincludes the two characters and 18 spaces. Your application will find the entry only if aWHEREclause searches for the string that includesMAand the 18 spaces. If the column is aVARCHAR2column, your application will find the entry if it searches for the two characters. TheVARCHAR2data type is more consistent with the ProgressCHARACTERdata type.ORACLE Numeric data type
ORACLE has only one numeric data type, which the DataServer translates to an OpenEdge
DECIMAL,INTEGER, orLOGICALdata type depending on the scale and precision of theNUMBERcolumn. However, OpenEdge handles the OpenEdgeINTEGERdata type more efficiently than it does aDECIMALdata type. You can use the OpenEdge Data Dictionary to change the data type fromDECIMALtoINTEGERin the schema image. See the "Modifying a schema image" section in Chapter 7, "The Data Server Tutorial," for instructions.ORACLE Number data
Consider the local version of the ORACLE database when accessing
NUMBERdata. The internal radix (decimal point symbol) varies among versions. For example, some European versions expect the radix to be a comma (,) rather than a period (.). The DataServer issues anALTERSESSIONSETSEPARATORstatement, which might result in stored procedures that you call from the Progress 4GL seeing a different radix separator.Logical data type and ORACLE equivalents
ORACLE does not have a
LOGICALdata type. You can change the data type for a field fromDECIMALtoLOGICALin the schema holder. OpenEdge then reads the numeric values stored in the ORACLE column, as Table 2–6 shows.
The DataServer stores the contents of an OpenEdge
LOGICALdata type in an ORACLENUMBERcolumn as:If you retain values other than 1 or 0 in the ORACLE column, do not write a value to that column as a
LOGICALdata type.ORACLE Date data type
The ORACLE
DATEdata type contains both date and time information. By default, in the schema image, an ORACLE date column is represented by two OpenEdge fields: aDATEfield and anINTEGERfield. The DataServer follows this convention when naming the fields: column column-1. For example, an ORACLE date column namedDate_Dueconverts to two fields namedDate_DueandDate_Due-1in the schema image.Date_Dueis aDATEfield andDate_Due-1is anINTEGERfield.OpenEdge converts the time component of the ORACLE date to an
INTEGERvalue. To convert theINTEGERvalue into time, use the Progress 4GLSTRINGandTIMEfunctions, as described in OpenEdge Development: Progress 4GL Reference .You can change the data type mapping for
Note: Do not include the time portion of a date field in an index.DATEtoCHARACTERin the schema image using the Data Dictionary. If you change the mapping, you must remove the column representing the time as anINTEGER. Use this feature only if you must use the time portion of an ORACLEDATEinWHEREclauses.ORACLE Date data type
The range of ORACLE
DATEare the years 4712 B.C. to 4712 A.D. The range ofDATEthat the DataServer supports are the years 999 B.C. to 9999 A.D. The DataServer converts all years greater than 4712 to 4712. For example, if your OpenEdge application updates aDATEcolumn with the year 4750, the DataServer converts it to 4712 before writing it to the ORACLE database.Progress 4GL supports Raw data type
The Progress 4GL supports
RAWdata types for non-OpenEdge databases. For information about programming using theRAWdata type, see OpenEdge Development: Progress 4GL Handbook . For information about the specific statements and functions, see OpenEdge Development: Progress 4GL Reference .ORACLE Blob and Bfile data types
The ORACLE
BLOBandBFILEdata types are used to store blocks of unstructured data. Database columns of these types store locators. For theBLOBdata type, the data is stored within the database. For theBFILE, the data is stored outside of ORACLE as an operating system file. For this reason, theBFILEdata type is read-only, and cannot be modified or participate in a transaction. For more information on how ORACLE defines these data types, see your ORACLE documentation. For information about programming using theBLOBdata type, see OpenEdge Development: Progress 4GL Handbook . For information about the specific statements and functions, see OpenEdge Development: Progress 4GL Reference .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |